<!DOCTYPE html>
<html>
<head>
    <title>灭火器</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="灭火器名称"/>
                </i-col>
                <i-col span="4">
<!--                    <i-input v-model="q.clientEnterpriseName" @on-enter="query" placeholder="公司名称"/>-->
                    <i-select v-model="q.clientEnterpriseName" filterable>
                        <i-option v-for="item in cityList" :value="item.id">{{ item.name }}</i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("fireextinguisher:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("fireextinguisher:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("fireextinguisher:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
                #if($shiro.hasPermission("fireextinguisher:delete"))
                <i-button type="info" @click="detail">&nbsp;巡查记录</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="fireExtinguisher" :rules="ruleValidate" :label-width="80">
            <Form-item label="灭火器名称" prop="name">
                <i-input v-model="fireExtinguisher.name" placeholder="灭火器名称"/>
            </Form-item>
            <Form-item label="购买公司" prop="linkClientEnterprise">
                <i-select v-model="fireExtinguisher.linkClientEnterprise" filterable>
                    <i-option v-for="item in cityList" :value="item.id">{{ item.name }}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="状态" prop="status">
                <i-select v-model="fireExtinguisher.status" filterable>
                    <i-option v-for="item in statusList" :value="item.value">{{ item.label }}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="创建时间" prop="createTime">
                <i-input v-model="fireExtinguisher.createTime" placeholder="创建时间"/>
            </Form-item>
            <Form-item label="有效期" prop="period">
                <i-input v-model="fireExtinguisher.period" placeholder="有效期"/>
            </Form-item>
<!--            <Form-item label="二维码" prop="qrCodeUrl">-->
<!--                <i-input v-model="fireExtinguisher.qrCodeUrl" placeholder="二维码"/>-->
<!--            </Form-item>-->
<!--            <Form-item label="二维码" prop="qrCode">-->
<!--                <i-input v-model="fireExtinguisher.qrCode" placeholder="二维码"/>-->
<!--            </Form-item>-->
            <Form-item label="位置" prop="position">
                <!--                <i-input v-model="fireExtinguisher.position" placeholder="位置"/>-->
                <iframe id="mapPage" width="100%" height="500px" frameborder=0
                        src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=5XUBZ-PYRRS-DKWOA-6JNSZ-DFYE5-R5FUF&referer=driver">
                </iframe>
            </Form-item>
            <Form-item label="位置" prop="position">
                <i-input v-model="fireExtinguisher.position" placeholder="位置"/>
            </Form-item>
            <Form-item label="经度" prop="longitude">
                <i-input v-model="fireExtinguisher.longitude" placeholder="经度"/>
            </Form-item>
            <Form-item label="纬度" prop="latitude">
                <i-input v-model="fireExtinguisher.latitude" placeholder="纬度"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/fs/fireextinguisher.js?_${date.systemTime}"></script>
</body>
</html>
